import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import * as echarts from 'echarts'
import dark from '@/utils/dark.js'
// 引入全局签名加密法
import JSEncrypt from 'jsencrypt'
import dataV from '@jiaminghi/data-view'

Vue.use(dataV)
/**
 * 配置全局的加密方法
 * @param obj 需要加密的字符串
 */
Vue.prototype.$encruption = function (password) {
  let encrypt = new JSEncrypt()
  encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5AL0WE0v++WO70HEm/Vp7strdkAveGsYUeZA8lFMbNdYZvLfAbN9kUoRTBLBjxOI6ejEysj0MCQ+k0oUvBIKOwyOkoSuT6wPrgFgVUvlxx51WMqb0CKLT085rmGyX5KCgmlHiD85W7ud49eZVdaDVA/nTw4IfYJgsOoQpme42dwIDAQAB')  // 放置自己的公钥
  let passwordEncryp = encrypt.encrypt(password)
  return passwordEncryp
}

echarts.registerTheme('dark', dark)
Vue.prototype.$echarts = echarts

Vue.use(ElementUI);
Vue.config.productionTip = false

import Viewer from "v-viewer";
import "viewerjs/dist/viewer.css";
Vue.use(Viewer);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
